fix: repair cross-package bugs so monorepo tests and tsc pass#36
Open
stooit wants to merge 1 commit into
Open
Conversation
- api.ts: import renamed useDebounce (was dead useThrottle export) - Button: forward aria-label to button element for accessible name - DataTable: fix stale-closure in handleSort via functional state updaters - date.ts: use en-AU dateStyle:short for day-first date formatting - bunfig.toml: preload happy-dom registrator so root bun test has DOM globals - tsconfig.json: register bun-types so tsc resolves Bun/bun:test globals
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes all failing tests and type errors across the monorepo so that
bun test && tsc --noEmitis clean from the repo root. 13/13 tests pass, tsc clean.Bugs fixed
apps/web/src/lib/api.ts) — the file imported a deaduseThrottleexport and re-exported it asuseSearchDebounce. Now imports the currentuseDebouncefrom@e2e/utils, fixingapi.test.ts(export 'useSearchDebounce' not found).packages/ui/Button.tsx) —aria-labelis now forwarded to the<button>so icon-only buttons have an accessible name.packages/ui/DataTable.tsx) — the sort handler captured stale state; fixed with functional state updaters so the controlled re-render test passes.packages/utils/format/date.ts) — now uses day-first (en-AU,dateStyle: short) formatting, e.g.1/03/2024, matchingdate.test.ts.Test-infra fixes (config, not test files)
bunfig.toml— added apreloadof the happy-dom global registrator so runningbun testfrom the repo root has DOM globals (document, etc.). Previously onlypackages/ui/bunfig.tomlpreloaded it, so root-level runs failed withdocument is not defined. No new dependency — the registrator was already installed and used by the package-level preload.tsconfig.json— registeredbun-typessotsc --noEmitresolves Bun /bun:testglobals. Strictness was not loosened.Assumptions
useDebounce(the surviving export inpackages/utils); the app's local re-export aliasuseSearchDebounceis preserved.en-AU), inferred from the1/03/2024expectation in the test.Verification
bun testfrom repo root → 13 pass / 0 fail across 5 files.tsc --noEmit→ clean (exit 0).Constraints honoured
No test files modified, no new dependencies added. Changes reviewed (verdict: approve).